'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1514183946804_9457';

  // add your config here
  config.middleware = [];

  // operator login password secret key
  config.operator_secret = 'shoushoushoushou';

  // 文件上传路径
  config.upload_path = 'face_dev/';

  config.mongoose = {
    url: 'mongodb://iface:iface123@192.168.200.234:27017/iface',
    options: {
      mongos: false
    },
  };

  // config.mongoose = {
  //   url: 'mongodb://localhost:27100,localhost:27101,localhost:27102/iface?replicaSet=configs',
  //   options: {
  //     mongos: true
  //   }
  // }
  
  // 支付
  config.pay = {
    // url: 'http://192.168.200.218:8115',
    url: 'http://192.168.200.219:8115',
    options: {
      secret: 'dev@EAvBDx4Ve^aq',
    },
  };

  // 短信
  config.sms = {
    // url: 'http://192.168.200.18:8114',
    url: 'http://192.168.200.219:8114',
    options: {
      ykqj: {
        signatureid: 4,
        templates: {
          cash: 300186,
          gift: 300186,
          virtual: 300186,
        },
      },
      qyl: {
        signatureid: 5,
        templates: {
          cash: 300186,
          gift: 300186,
          virtual: 300186,
        },
      },
      qsjs: {
        signatureid: 8,
        templates: {
          cash: 300186,
          gift: 300186,
          virtual: 300186,
        },
      },
    },
  };

  config.redis = {
    client: {
      port: 6379,
      host: '127.0.0.1',
      password: null,
      db: 0,
    },
  };

  config.mysql = {
    client: {
      host: '192.168.200.19',
      port: '3306',
      user: 'namibank',
      password: 'namibank123',
      database: 'base',
    },
    app: true,
    agent: false,
  };


  return config;
};
